<template>
  <div class="main">
    <div class="content">
      <div class="input_wrap">
        <div class="text_wrap">
          <span class="input_tip">维修点名</span>
        </div>
        <input class="input_text" type="text" v-model="name">
      </div>
      <div class="input_wrap">
        <div class="text_wrap">
          <span class="input_tip">维修点地址</span>
        </div>
        <input class="input_text" type="text" v-model="address">
      </div>
      <div class="input_wrap">
        <div class="text_wrap">
          <span class="input_tip">维修点负责人</span>
        </div>
        <input class="input_text" type="text" v-model="leader">
      </div>
      <div class="input_wrap">
        <div class="text_wrap">
          <span class="input_tip">维修点联系电话</span>
        </div>
        <input class="input_text" type="number" v-model="phone">
      </div>
      <div class="button_wrap">
        <div class="button" @click="record">录入</div>
      </div>
    </div>
  </div>
</template>

<script>
import salesPersonService from '../../service/salesperson'
export default {
  name: 'RecordAfterSaleCenter',
  data () {
    return {
      name: '',
      address: '',
      leader: '',
      phone: null
    }
  },
  mounted () {
  },
  methods: {
    async record () {
      const data = {
        name: this.name,
        address: this.address,
        phone: this.phone,
        leader: this.leader
      }
      let result = await salesPersonService.recordAfterSaleCenter(data)
      if (result.data > 0) {
        alert('录入成功')
      } else {
        alert('录入失败')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
  .main{
    width: 100%;
    height: calc(100% - 1px);
    background: #FFFFFF;
    border-top: 1px solid transparent;
    .content {
      width: 500px;
      margin: 200px auto;
      /*border: 2px solid red;*/
      .input_wrap {
        width: 500px;
        height: 50px;
        .text_wrap{
          width: 190px;
          float: left;
          text-align: right;
          padding: 0 10px 0 0;
          .input_tip{
            font-size: 20px;
          }
        }
        .input_text {
          width: 250px;
          height: 20px;
        }
      }
      .button_wrap {
        /*border: 1px solid black;*/
        width: 500px;
        height: 100px;
        .button {
          margin: 10px auto;
          width: 200px;
          height: 50px;
          border-radius: 10px;
          border: 2px solid black;
          text-align: center;
          font-size: 20px;
          line-height: 50px;
        }
      }
    }
  }

</style>
